import { BASE_URL } from '@/config/public'
import { METHOD, request } from '@/utils/request'

export default {
  //查询理赔列表
  claimsList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/claims/list`,
      METHOD.GET,
      params
    )
  },
  //理赔详情接口
  claimsDetail: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/claims/record/details`,
      METHOD.GET,
      params,
      { isNeedToken: false }//不需要登陆
    )
  },
  //理赔上传
  claimsUpload: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/claims/record/upload`,
      METHOD.POST_FORM,
      params,
      { isNeedToken: false }//不需要登陆
    )
  },
  claimsDelete: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/claims/record/delete`,
      METHOD.DELETE_JSON,
      params,
      { isNeedToken: false }//不需要登陆
    )
  },
  //保存理赔信息接口
  claimsSave: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/claims/save`,
      METHOD.POST_JSON_ENCRYPT,
      params,
      { isNeedToken: false }//不需要登陆
    )
  },
  //注销用户接口
  userCancel: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/logout/cancel`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  // 查询订单列表
  orderList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/order/list`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //查询订单明细
  orderDetail: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/order/detail`,
      METHOD.GET,
      params
    )
  },
  //查询客户列表
  customerList: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/customer`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //查询客户明细
  customerIndetail: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/customer/detail`,
      METHOD.GET,
      params
    )
  },
  //查询个人资料
  personal: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/member`,
      METHOD.GET,
      params
    )
  },
  //会员上传头像接口
  upload: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/file/upload`,
      METHOD.POST_FORM,
      // { responseType: 'blob' },
      params
    )
  },
  //查询帮助中心问题列表
  helpcenter: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/helpcenter`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //查询我的预估收入接口
  income: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/income`,
      METHOD.GET,
      params
    )
  },
  //设置登录密码
  password: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/password`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //重新设置登录密码
  rePassword: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/password/reset`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //查询个人收入按照年月展示信息
  getIncomByYearM: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/income/yearmonth`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //查询个人收入-月度报表
  getIncomeMonthReport: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/income/yearmonth/report`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  // 新增客户
  addCustomer: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/customer/add`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //获取加入万利问卷
  question: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/join/question`,
      METHOD.POST_JSON_ENCRYPT,
      params,
      { isNeedToken: false }
    )
  },
  // 保存加入万利的个人信息
  joinAddInfo: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/join/add`,
      METHOD.POST_JSON_ENCRYPT,
      params,
      { isNeedToken: false }
    )
  },
  //未读消息
  getMsg: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/message/count/unread`,
      METHOD.GET,
      params
    )
  },
  //退出登录
  exitLogin: params => {
    return request(`${BASE_URL}/provider/ims/ejbb/logout/`, METHOD.GET, params)
  },
  //获取变更前手机号的验证码
  getoldValidation: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/modify/mobile/sms`,
      METHOD.GET,
      params
    )
  },
  //校验变更前手机号的验证码
  checkoldValidation: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/check/modify/mobile/sms`,
      METHOD.GET,
      params
    )
  },
  //获取变更后手机号的验证码
  getvalidation: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/modify/latest/mobile/sms`,
      METHOD.GET,
      params
    )
  },
  //保存修改后的手机号
  savePhone: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/personal/modify/mobile`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  }
}
